home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 July: Mac OS SDK / Dev.CD Jul 96 SDK / Dev.CD Jul 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc Development Framework / ODFDev / ODF / Found / FWRefCnt / Sources / SLRefCnt.cpp < prev   
Encoding:
Text File  |  1996-04-25  |  3.1 KB  |  105 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                SLRefCnt.cpp
  4. //    Release Version:    $ ODF 1 $
  5. //
  6. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #include "FWFound.hpp"
  11.  
  12. #ifndef FWDEBUG_H
  13. #include "FWDebug.h"
  14. #endif
  15.  
  16. #ifndef FWODEXCE_H
  17. #include "FWODExce.h"
  18. #endif
  19.  
  20.  
  21. /*
  22.  *  This file was generated by the SOM Compiler.
  23.  *  Generated using: 
  24.  *      SOM Emitter emitxtm.dll: 2.33
  25.  */
  26.  
  27. #ifdef FW_BUILD_MAC
  28. #pragma segment FWStream
  29. #endif
  30.  
  31. #define FW_ORefCount_Class_Source
  32. #include "SLRefCnt.xih"
  33.  
  34. #if defined(__MWERKS__) && GENERATING68K
  35. // A hack to work around a bug
  36. #pragma import list somPrintf
  37. #endif
  38.  
  39. //----------------------------------------------------------------------------------------
  40. //    FW_ORefCountAcquire
  41. //----------------------------------------------------------------------------------------
  42.  
  43. SOM_Scope void  SOMLINK FW_ORefCountAcquire(FW_ORefCount *somSelf, Environment *)
  44. {
  45.     FW_ORefCountData *somThis = FW_ORefCountGetData(somSelf);
  46.     FW_ORefCountMethodDebug("FW_ORefCount","FW_ORefCountAcquire");
  47.  
  48.     somThis->fRefCount++;
  49. }
  50.  
  51.  
  52. //----------------------------------------------------------------------------------------
  53. //    FW_ORefCountRelease
  54. //----------------------------------------------------------------------------------------
  55.  
  56. SOM_Scope long  SOMLINK FW_ORefCountRelease(FW_ORefCount *somSelf, Environment *)
  57. {
  58.     FW_ORefCountData *somThis = FW_ORefCountGetData(somSelf);
  59.     FW_ORefCountMethodDebug("FW_ORefCount","FW_ORefCountRelease");
  60.  
  61.     FW_ASSERT(somThis->fRefCount != 0);
  62.     return --somThis->fRefCount;
  63. }
  64.  
  65.  
  66. //----------------------------------------------------------------------------------------
  67. //    FW_ORefCountGetRefCount
  68. //----------------------------------------------------------------------------------------
  69.  
  70. SOM_Scope long  SOMLINK FW_ORefCountGetRefCount(FW_ORefCount *somSelf, Environment *)
  71. {
  72.     FW_ORefCountData *somThis = FW_ORefCountGetData(somSelf);
  73.     FW_ORefCountMethodDebug("FW_ORefCount","FW_ORefCountGetRefCount");
  74.  
  75.     return somThis->fRefCount;
  76. }
  77.  
  78.  
  79. //----------------------------------------------------------------------------------------
  80. //    FW_ORefCountsomInit
  81. //----------------------------------------------------------------------------------------
  82.  
  83. SOM_Scope void  SOMLINK FW_ORefCountsomInit(FW_ORefCount *somSelf)
  84. {
  85.     FW_ORefCountData *somThis = FW_ORefCountGetData(somSelf);
  86.     FW_ORefCountMethodDebug("FW_ORefCount","FW_ORefCountsomInit");
  87.  
  88.     FW_ORefCount_parent_SOMObject_somInit(somSelf);
  89.     somThis->fRefCount = 0;
  90. }
  91.  
  92.  
  93. //----------------------------------------------------------------------------------------
  94. //    FW_ORefCountsomUninit
  95. //----------------------------------------------------------------------------------------
  96.  
  97. SOM_Scope void  SOMLINK FW_ORefCountsomUninit(FW_ORefCount *somSelf)
  98. {
  99.     FW_ORefCountData *somThis = FW_ORefCountGetData(somSelf);
  100.     FW_ORefCountMethodDebug("FW_ORefCount","FW_ORefCountsomUninit");
  101.     
  102.     FW_ASSERT(somThis->fRefCount == 0);
  103.     FW_ORefCount_parent_SOMObject_somUninit(somSelf);
  104. }
  105.